﻿namespace CC_NSISrunner
{
    /// <summary>
    /// class support NSIS output validation
    /// We ignore validation jet
    /// </summary>
    public class NsisOutputStateMachine
    {
        public enum EState
        {
            None,
            VersionFound,
            PluginsBegin,
            PluginsEnd,
            ChangingDirectory,
            ScriptBegin,
            ScriptEnd,
            ProcessedBegin,
            ProcessedEnd,
            OutputBegin,
            OutputEnd,
            Error,
        }

        private EState currentState;
        private bool newLine = false;

        public void SetNewLine()
        {
            newLine = true;
        }

        public void SetState(EState newState)
        {
            currentState = newState;
            newLine = false;
        }

        public EState CurrentState
        {
            get { return currentState; }
        }

        public bool IsNewLineAfterState
        {
            get { return newLine; }
        }
    }
}
